@extends('layouts.tankuang')

@section('content')
       

	 <div id="taby" class="easyui-tabs" border="false" style="width:100%;overflow: hidden;" fit="true">
         <div title="基本情况" style="overflow:hidden;">
            <iframe scrolling="auto" frameborder="0"  src="{{url('admin/yanpan/jibenqingkuang')}}" style="width:100%;height:100%;"></iframe>
        </div>
        <div title="优良记录" style="overflow:hidden;">
            <iframe scrolling="auto" frameborder="0"  src="{{url('admin/yanpan/youliang')}}" style="width:100%;height:100%;"></iframe>
        </div>
        <div title="负面记录" style="overflow:hidden;">
            <iframe scrolling="auto" frameborder="0"  src="{{url('admin/yanpan/fumian')}}" style="width:100%;height:100%;"></iframe>
        </div>
        <div title="受惩黑名单" style="overflow:hidden;">
            <iframe scrolling="auto" frameborder="0"  src="{{url('admin/yanpan/heimingdan')}}" style="width:100%;height:100%;"></iframe>
        </div>
    </div>
    
    
    
    <script>
    $(document).ready(function(){
    	var winHeight =  window.screen.height;
		var winWidth = 	window.screen.width;
		if(winWidth == 1024){
	  	 	$('#taby').css('height',465+'px');
	  	 	$('#taby').find('iframe').css('height',436+'px');
		   }else if(winWidth == 1280){
	  	 	$('#taby').css('height',465+'px');
	  	 	$('#taby').find('iframe').css('height',436+'px');
		   }else if(winWidth == 1366){
		   	$('#taby').css('height',465+'px'); $('#taby').find('iframe').css('min-height',436+'px');
		   }else if(winWidth == 1920){
	   		$('#taby').css('min-height',($('#w').height()-27)+'px');
	   		$('#taby').find('iframe').css('min-height',($('#w').height()-27)+'px');
		   }else{
	   		$('#taby').css('height',465+'px');
	   		$('#taby').find('iframe').css('min-height',436+'px');
		   }
    })

	function load_city_data_from_menu($id){
		$('#dg').datagrid('load',{
			city: $id,
		});
		$("input[name='city']").val($id);
		$("input[name='area']").val('');
		$("input[name='org_id']").val('');
	}

	function load_area_data_from_menu($id){
		$('#dg').datagrid('load',{
			area: $id,
		});
		$("input[name='city']").val('');
		$("input[name='area']").val($id);
		$("input[name='org_id']").val('');
	}
	function load_org_data_from_menu($id){
		$('#dg').datagrid('load',{
			org_id: $id,
		});
		$("input[name='city']").val('');
		$("input[name='area']").val('');
		$("input[name='org_id']").val($id);
	}
    </script>



        <script type="text/javascript">


            $(document).on("change",'#city', function(){
                $('#area option:gt(0)').remove();
                $('#org_id option:gt(0)').remove();
                //alert(1);die;
                var cid = $("#city").val();
                var url = "{{url('admin/getArea')}}";
                $.getJSON(url,{cid:cid},function(json){
                    /*清空原有的选项*/
                    if(json != ''){
                        $.each(json,function(index,array){
                            var option = "<option value='"+array['id']+"'";
                            option += ">"+array['name']+"</option>";
                            $("#area").append(option);
                        });
                    }
                });
            });

            $(document).on("change",'#area', function(){
                $('#org_id option:gt(0)').remove();
                var cid = $("#area").val();
                var url = "{{url('admin/getArea')}}";
                $.getJSON(url,{cid:cid},function(json){
                    /*清空原有的选项*/
                    if(json != ''){
                        $.each(json,function(index,array){
                            var option = "<option value='"+array['id']+"'";
                            option += ">"+array['name']+"</option>";
                            $("#org_id").append(option);
                        });
                    }
                });
            });
        </script>
        <script>
            $('#go').click(function (){
                var formData = new FormData($( "#add_form" )[0]);
                $.ajax({
                    type: "POST",
                    url: "{{url('admin/yanpan/add')}}",
                    data: formData,
                    async: false,
                    cache: false,
                    contentType: false,
                    processData: false,

                    success: function(data) {
                        if(data.status == 1){
                            $.messager.alert('信息提示',data.msg,'info');
                            $('#w').dialog('close');
                            $('.pagination-load').click();
                        }else {
                            $.messager.alert('信息提示',data.msg,'info');
                        }
                    }
                });
            });
        </script>
@stop